<h1>Zauzeće lokacija</h1>

<?= $this->Form->create('Filter', array(
    'class'    => 'filter-form',
    'onsubmit' => 'isPrint(this);'
)) ?>

    <?= $this->Form->label('location_id', 'Lokacija:') ?>
    <?= $this->Form->select('location_id', $locations, array(
        'empty' => false,
        'value' => @$filter['location_id']
    )) ?>
    
    <?= $this->Form->label('start', 'Period:') ?>
    <?= $this->Form->text('start', array(
        'class' => 'datepicker',
        'value' => @$filter['start']
    )) ?>
    -
    <?= $this->Form->text('end', array(
        'class' => 'datepicker',
        'value' => @$filter['end']
    )) ?>
    

<?= $this->Form->submit('Traži') ?>
<div class="right" style="margin:0 5px">
    <?= $this->Form->label('print', 'Štampa:') ?>
    <?= $this->Form->checkbox('print') ?>
</div>
<?= $this->Form->end() ?>

<?= $this->element('../Reports/_location_occupation') ?>

<script type="text/javascript">
function isPrint(form) {
    var form = $(form);
    var chk  = form.find('input[type=checkbox]');
    if(chk[0].checked){
        form.attr('target', '_blank');
    } else {
        form.attr('target', null);
    }
}
</script>
